#include "linkStack.h"

linkStack::linkStack()
{
}

linkStack::~linkStack()
{
}

void linkStack::push(const elementType &element)
{
    list.insertByIndex(0,element);
}

void linkStack::pop()
{
    if(list.Size()==0)
        return;
    list.removeByIndex(0);
}

linkStack:: elementType* linkStack::getTop()
{
    if(list.Size()==0)
        return nullptr;
    return list.findByIndex(0);
    
}

bool linkStack::isEmpty()
{
    return list.Size()==0;
}
